package com.cskaoyan.controller.wx_topic;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.PageDataVo;
import com.cskaoyan.bean.wx_topic.TopicBaseParam;
import com.cskaoyan.bean.wx_topic.WXDetailVO;
import com.cskaoyan.service.wx_topic.WXTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/topic")
public class WXTopicController {
    @Autowired
    WXTopicService wxTopicService;

    @RequestMapping("list")
    public BaseRespVo listTopic(TopicBaseParam baseParam) {
        PageDataVo pageDataVo = wxTopicService.listTopic(baseParam);
        return BaseRespVo.ok(pageDataVo);
    }
    @RequestMapping("detail")
    public BaseRespVo topicDetail(Integer id){
        WXDetailVO wxDetailVO = wxTopicService.topicDetail(id);
        return BaseRespVo.ok(wxDetailVO);
    }
    @RequestMapping("related")
    public BaseRespVo showRelated(Integer id){
        PageDataVo pageDataVo = wxTopicService.showRelated(id);
        return BaseRespVo.ok(pageDataVo);
    }
}
